<!DOCTYPE html>




        boy.push('个')
        boy.push('大')
        boy.push('哥')
        //写入数组
        let girl = [];
        girl.push({id:1,name:"小花",age:16})
        girl.push({id:2,name:'小红',age:18})
        //对象要转换json 才可以写入
        localStorage.girl=JSON.stringify(girl);
        //键值对
        localStorage.gaoshou = "高手"
        localStorage.dage=boy;
        //键值对
        localStorage.setItem("张","伟");
localStorage.setItem("黄","伟");
localStorage.setItem("高","手");
for(let i = 0;i<localStorage.length;i++){
    let key = localStorage.key(i);
    let value = localStorage.getItem(key);
    console.log(key + value);
}
    </script>
</body>
</html>